
const express = require('express');
const router = express.Router();

const articleController = require('../controllers/articleController');

const { verifyAuthToken } = require('../middlewares/auth/verifyAuth');


// 文章列表路由
const { verifyArticleList } = require("../middlewares/article/verifyArticleList");
router.post('/list', articleController.getArticleList);

// 文章详情路由
router.get('/detail/:id', articleController.getArticleDetail);

// 文章创建路由
const { verifyArticleCreate, verifyArticleDelete } = require("../middlewares/article/verifyArticleCreate");
router.post('/create', verifyAuthToken, verifyArticleCreate, articleController.createArticle);

// 文章更新路由
router.post('/update', verifyAuthToken, verifyArticleCreate, articleController.updateArticle);

// 文章删除路由
router.post('/delete', verifyAuthToken, verifyArticleDelete, articleController.deleteArticle);

// 批量删除文章
router.post('/delete/batch', verifyAuthToken, articleController.deleteBatchArticles);


module.exports = router